﻿@model PlanningPokerMVC.Models.SettingsViewModel

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">

    $(document).ready(function () {

        $("#progressbar").progressbar({
            value: 0
        });

        //$("#progressbar").hide()



        $('.datepicker').datepicker();


    });


        $(document).ready(function () {
            $("#projects").kendoGrid({
                dataSource: {
                    type: "json",
                    transport: {
                        read: "/Settings/Projects"
                    },
                    schema: {
                        model: {
                            fields: {
                                Id: { type: "number" },
                                Name: { type: "string" }
                            }
                        }
                    },
                    pageSize: 10,
                    serverPaging: true,
                    serverFiltering: true,
                    serverSorting: true
                },
                height: 250,
                filterable: true,
                sortable: true,
                pageable: true,
                columns: [{
                    field: "Id",
                    filterable: false
                },
                                "Name"
                            ]
            });
        });



</script>


<h2>Settings</h2>
<hr />
<br />
<br />

<h3>Work Item Sync</h3>
<hr />
<button id="workitemsyncbutton" title="Sync Work Items">Sync Work Items</button>
@*<a id="workitemsyncbutton" href="">Sync Work Items</a>*@
<br />
<input id="synccheckbox" type="checkbox" />&nbsp;&nbsp;Purge existing Work Items? 
<br />
<div id="progressbar" style="width:250px;Height:20px"  ></div>
<br />
<b>Status:</b>&nbsp;&nbsp;&nbsp;<span id="syncmessage"></span>




<br />
<br />
<br />
<br />
<h3>Project Listing </h3>
<hr />

<div id="projects"></div>

<br />
<br />

<h3>Query Listing </h3>
<hr />
<table id="queryGrid"></table>






@*<table id="queries" width="100%">
<thead>
    <tr>
        <th>Query Id</th>
        <th>Name</th>
    </tr>
</thead>
<tbody>
    @foreach (var item in Model.Queries)
    {
        <tr data-pkey="@item.Id">
            <td>@Html.DisplayFor(modelItem => item.Id)</td>
            <td>@Html.DisplayFor(modelItem => item.Name)</td>
        </tr>
    }
</tbody>
</table>
*@



